import 'package:taonile/generated/json/base/json_convert_content.dart';
import 'package:taonile/entity/bank_list_entity.dart';

BankListEntity $BankListEntityFromJson(Map<String, dynamic> json) {
	final BankListEntity bankListEntity = BankListEntity();
	final int? code = jsonConvert.convert<int>(json['code']);
	if (code != null) {
		bankListEntity.code = code;
	}
	final String? msg = jsonConvert.convert<String>(json['msg']);
	if (msg != null) {
		bankListEntity.msg = msg;
	}
	final BankListData? data = jsonConvert.convert<BankListData>(json['data']);
	if (data != null) {
		bankListEntity.data = data;
	}
	return bankListEntity;
}

Map<String, dynamic> $BankListEntityToJson(BankListEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['code'] = entity.code;
	data['msg'] = entity.msg;
	data['data'] = entity.data.toJson();
	return data;
}

BankListData $BankListDataFromJson(Map<String, dynamic> json) {
	final BankListData bankListData = BankListData();
	final String? currentPage = jsonConvert.convert<String>(json['current_page']);
	if (currentPage != null) {
		bankListData.currentPage = currentPage;
	}
	final List<BankListDataData>? data = jsonConvert.convertListNotNull<BankListDataData>(json['data']);
	if (data != null) {
		bankListData.data = data;
	}
	return bankListData;
}

Map<String, dynamic> $BankListDataToJson(BankListData entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['current_page'] = entity.currentPage;
	data['data'] =  entity.data.map((v) => v.toJson()).toList();
	return data;
}

BankListDataData $BankListDataDataFromJson(Map<String, dynamic> json) {
	final BankListDataData bankListDataData = BankListDataData();
	final String? id = jsonConvert.convert<String>(json['id']);
	if (id != null) {
		bankListDataData.id = id;
	}
	final String? userId = jsonConvert.convert<String>(json['user_id']);
	if (userId != null) {
		bankListDataData.userId = userId;
	}
	final String? type = jsonConvert.convert<String>(json['type']);
	if (type != null) {
		bankListDataData.type = type;
	}
	final String? realName = jsonConvert.convert<String>(json['real_name']);
	if (realName != null) {
		bankListDataData.realName = realName;
	}
	final String? idNumber = jsonConvert.convert<String>(json['id_number']);
	if (idNumber != null) {
		bankListDataData.idNumber = idNumber;
	}
	final String? bankNumber = jsonConvert.convert<String>(json['bank_number']);
	if (bankNumber != null) {
		bankListDataData.bankNumber = bankNumber;
	}
	final String? bankName = jsonConvert.convert<String>(json['bank_name']);
	if (bankName != null) {
		bankListDataData.bankName = bankName;
	}
	final String? province = jsonConvert.convert<String>(json['province']);
	if (province != null) {
		bankListDataData.province = province;
	}
	final String? city = jsonConvert.convert<String>(json['city']);
	if (city != null) {
		bankListDataData.city = city;
	}
	final String? district = jsonConvert.convert<String>(json['district']);
	if (district != null) {
		bankListDataData.district = district;
	}
	final String? bankBranch = jsonConvert.convert<String>(json['bank_branch']);
	if (bankBranch != null) {
		bankListDataData.bankBranch = bankBranch;
	}
	final String? mobile = jsonConvert.convert<String>(json['mobile']);
	if (mobile != null) {
		bankListDataData.mobile = mobile;
	}
	final String? createdAt = jsonConvert.convert<String>(json['created_at']);
	if (createdAt != null) {
		bankListDataData.createdAt = createdAt;
	}
	final String? updatedAt = jsonConvert.convert<String>(json['updated_at']);
	if (updatedAt != null) {
		bankListDataData.updatedAt = updatedAt;
	}
	final String? provinceName = jsonConvert.convert<String>(json['province_name']);
	if (provinceName != null) {
		bankListDataData.provinceName = provinceName;
	}
	final String? cityName = jsonConvert.convert<String>(json['city_name']);
	if (cityName != null) {
		bankListDataData.cityName = cityName;
	}
	return bankListDataData;
}

Map<String, dynamic> $BankListDataDataToJson(BankListDataData entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['user_id'] = entity.userId;
	data['type'] = entity.type;
	data['real_name'] = entity.realName;
	data['id_number'] = entity.idNumber;
	data['bank_number'] = entity.bankNumber;
	data['bank_name'] = entity.bankName;
	data['province'] = entity.province;
	data['city'] = entity.city;
	data['district'] = entity.district;
	data['bank_branch'] = entity.bankBranch;
	data['mobile'] = entity.mobile;
	data['created_at'] = entity.createdAt;
	data['updated_at'] = entity.updatedAt;
	data['province_name'] = entity.provinceName;
	data['city_name'] = entity.cityName;
	return data;
}